#! /usr/bin/env python

PACKAGE="okvis_ros"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

# ========================= CAMERA 0 ==========================
#       Name       Type      Level Description     Default Min   Max
gen.add("cam0_name", str_t,    0,    "camera 0", "cam0")
gen.add("cam0_agc_enable",       bool_t,    0,    "automatic gain control", True)
gen.add("cam0_max_analog_gain",       int_t,    0,    "max analog gain", 64,     16, 64)
gen.add("cam0_global_analog_gain",       int_t,    0,    "analog gain", 16,     16, 64)
gen.add("cam0_global_analog_gain_attenuation",       bool_t,    0,    "gain attenuation", False)

gen.add("digital_gain",       int_t,    0,    "digital gain", 4,     1, 15)


gen.add("cam0_aec_enable",       bool_t,    0,    "automatic exposure control", True)
gen.add("cam0_min_coarse_shutter_width",       int_t,    0,    "min shutter width", 2,     2, 32765)
gen.add("cam0_max_coarse_shutter_width",       int_t,    0,    "max shutter width", 500,     2, 32765)
gen.add("cam0_coarse_shutter_width",       int_t,    0,    "shutter", 480,     2, 32765)
gen.add("cam0_fine_shutter_width",       int_t,    0,    "shutter", 0,     0, 1774)

gen.add("cam0_adc_mode",       int_t,    0,    "ADC Mode", 2,2,3)
gen.add("cam0_vref_adc_voltage_level",       int_t,    0,    "Vref ADC Voltage level", 4,0,7)

gen.add("cam0_black_level_calibration_manual_override",       bool_t,    0,    "Black level calibration manual override", False)
gen.add("cam0_black_level_calibration_value",       int_t,    0,    "Black level calibration value", 0,-127,127)


# ========================= CAMERA 1 ==========================

gen.add("cam1_name", str_t,    0,    "camera 1", "cam1")
gen.add("cam1_agc_enable",       bool_t,    0,    "automatic gain control", True)
gen.add("cam1_max_analog_gain",       int_t,    0,    "max analog gain", 64,     16, 64)
gen.add("cam1_global_analog_gain",       int_t,    0,    "analog gain", 16,     16, 64)
gen.add("cam1_global_analog_gain_attenuation",       bool_t,    0,    "gain attenuation", False)

gen.add("cam1_aec_enable",       bool_t,    0,    "automatic exposure control", True)
gen.add("cam1_min_coarse_shutter_width",       int_t,    0,    "min shutter width", 2,     2, 32765)
gen.add("cam1_max_coarse_shutter_width",       int_t,    0,    "max shutter width", 500,     2, 32765)
gen.add("cam1_coarse_shutter_width",       int_t,    0,    "shutter", 480,     2, 32765)

gen.add("cam1_adc_mode",       int_t,    0,    "ADC Mode", 2,2,3)
gen.add("cam1_vref_adc_voltage_level",       int_t,    0,    "Vref ADC Voltage level", 4,0,7)

# ========================= CAMERA 2 ==========================

gen.add("cam2_name", str_t,    0,    "camera 2", "cam2")
gen.add("cam2_agc_enable",       bool_t,    0,    "automatic gain control", True)
gen.add("cam2_max_analog_gain",       int_t,    0,    "max analog gain", 64,     16, 64)
gen.add("cam2_global_analog_gain",       int_t,    0,    "analog gain", 16,     16, 64)
gen.add("cam2_global_analog_gain_attenuation",       bool_t,    0,    "gain attenuation", False)

gen.add("cam2_aec_enable",       bool_t,    0,    "automatic exposure control", True)
gen.add("cam2_min_coarse_shutter_width",       int_t,    0,    "min shutter width", 2,     2, 32765)
gen.add("cam2_max_coarse_shutter_width",       int_t,    0,    "max shutter width", 500,     2, 32765)
gen.add("cam2_coarse_shutter_width",       int_t,    0,    "shutter", 480,     2, 32765)

gen.add("cam2_adc_mode",       int_t,    0,    "ADC Mode", 2,2,3)
gen.add("cam2_vref_adc_voltage_level",       int_t,    0,    "Vref ADC Voltage level", 4,0,7)

# ========================= CAMERA 3 ==========================

gen.add("cam3_name", str_t,    0,    "camera 3", "cam3")
gen.add("cam3_agc_enable",       bool_t,    0,    "automatic gain control", True)
gen.add("cam3_max_analog_gain",       int_t,    0,    "max analog gain", 64,     16, 64)
gen.add("cam3_global_analog_gain",       int_t,    0,    "analog gain", 16,     16, 64)
gen.add("cam3_global_analog_gain_attenuation",       bool_t,    0,    "gain attenuation", False)

gen.add("cam3_aec_enable",       bool_t,    0,    "automatic exposure control", True)
gen.add("cam3_min_coarse_shutter_width",       int_t,    0,    "min shutter width", 2,     2, 32765)
gen.add("cam3_max_coarse_shutter_width",       int_t,    0,    "max shutter width", 500,     2, 32765)
gen.add("cam3_coarse_shutter_width",       int_t,    0,    "shutter", 100,     2, 32765)

gen.add("cam3_adc_mode",       int_t,    0,    "ADC Mode", 2,2,3)
gen.add("cam3_vref_adc_voltage_level",       int_t,    0,    "Vref ADC Voltage level", 4,0,7)

exit(gen.generate(PACKAGE, "okvis_ros", "Camera"))
